import { AppDto, AppItem, MircoserviceItem } from '../model/apiFormModel';
import { maintenanceHttp } from '/@/utils/http/axios';

enum Api {
  APP_FOR_ADMIN = '/api/form/appadmin',
  MICROSERVICE_LIST_BY_APP = '/api/form/microservice',
}

export const getApplicationForAdmin = () => {
  return maintenanceHttp.get<AppItem[]>({ url: Api.APP_FOR_ADMIN });
};

export const getMicroserviceByApp = (params: AppDto) => {
  return maintenanceHttp.get<MircoserviceItem[]>({
    url: Api.MICROSERVICE_LIST_BY_APP,
    params,
  });
};
